package com.hystrix.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;
import com.hystrix.model.InfoB;

@RestController
@RequestMapping(value = "/service/a")
public class ServiceAController {

	@RequestMapping(value = "/info")
	public String getInfo() {
		InfoB info = new InfoB();
		info.setService("serviceA");
		info.setInfo("我是服务A");
		return JSONObject.toJSONString(info);
	}

	@RequestMapping(value = "/maxThread")
	public String getMaxThread() {
		InfoB info = new InfoB();
		info.setService("serviceA");
		info.setInfo("我是服务A");
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		return JSONObject.toJSONString(info);
	}

}
